export default{
    get(){
        return JSON.parse(window.localStorage.getItem("weir-token") || '{}');
    },
    setItem(key,val){
        let storage = this.get();
        storage[key] = val;
        window.localStorage.setItem("weir-token", JSON.stringify(storage));
    },
    getItem(key){
        return this.get()[key];
    },
    clearItem(key){
        let storage = this.get();
        delete storage[key];
        window.localStorage.setItem("weir-token", JSON.stringify(storage));
    },
    clearAll(){
        window.localStorage.clear;
    }
}